import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { setupRouter } from './router/index'
import ElementPlus from 'element-plus'
import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
import elementIcons from './components/common/SvgIcon/svgicon.js'
import App from './App.vue'


import 'element-plus/dist/index.css'
import '@/assets/styles/common.scss'

// svg图标
import 'virtual:svg-icons-register'
import SvgIcon from './components/common/SvgIcon/index.vue'

const app = createApp( App )

app.use(createPinia().use(piniaPluginPersistedstate))
app.use( ElementPlus, {
  locale: locale,
  // 支持 large、default、small
  size: 'default'
})
// svg
app.use( elementIcons )
app.component( 'svg-icon', SvgIcon )

// 配置路由
setupRouter( app )
app.mount( '#app' )
